 <link href="<?= STATICURL; ?>css/bootstrap.min.css" rel="stylesheet" />
    <link id="bootstrap-rtl-link" href="" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/font-awesome.min.css" rel="stylesheet" />
    <!--Fonts-->
    <!--Beyond styles-->
    <link id="beyond-link" href="<?= STATICURL; ?>css/beyond.min.css" rel="stylesheet" type="text/css" />
    <link href="<?= STATICURL; ?>css/demo.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="<?=STATICURL;?>css/oss_style.css"/>
    <div class="page-content">
        <div class="page-body">
            <div >
                <div id="horizontal-form">
                    <form class="form-horizontal" role="form">
                        <div class="row">
                            <div class="col-md-7">
                                <input type="text" name="redirecturl" placeholder="新闻id" class="form-control" value="<?= $AdInfo['redirecturl']?>">
                                <div class="horizontal-space"></div>
                                <span style="color:red">（注：轮播图建议上传图片长宽比3:1像素）</span>
                            </div>
                        </div>

                        <div class="widget-content">
                            <div class='clearfix' style="margin-top:15px;">
                                <div id="container" style="float: left">
                                    <a id="selectfiles" href="javascript:void(0);" class='btn'>选择图片</a>
                                    <a id="postfiles" href="javascript:void(0);" class='btn'>开始上传</a>
                                </div>
                                <span id="console"></span>
                                <?php if($AdInfo['imgurl']):?>
                                <span id = "ossfile"  style="position:relative;float:right;margin-left:5px;">
                                    <div class="bg_floating" style="float:right;margin-right:10px;">
                                        <img class="uploadpic" img-original='<?= $AdInfo['imgurl'] ?>' src="<?= OSSHOST.$AdInfo['imgurl'] ?>" width="120px" height="80px" alt="pic"/>
                                    </div><br />
                                    <a class="del_pic" style="margin-left:40px;" href="javascript:void(0);">删除</a>
                                </span>
                                <?php else :?>
                                <span id="ossfile" style="position:relative;float:right;margin-left:5px">
                                </span>
                                <?php endif;?>
                            </div>
                        </div>
                        <div class="horizontal-space"></div>
                        <div>
                            <span id="editAd" class="btn btn-default">提交</span>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <input type="hidden" id="idpalce" value="<?= $AdInfo['id']?>" />
<script src="<?= STATICURL; ?>js/jquery.min.js"></script>
<script src="<?= STATICURL; ?>js/bootstrap.min.js"></script>
<script src="<?= STATICURL; ?>layer/layer.js"></script>
<script src="<?= STATICURL; ?>kindeditor/kindeditor.js"></script>

<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>
<script src="<?= STATICURL; ?>js/jquery.min.js"></script>
<script type="text/javascript" src="<?=STATICURL;?>js/plupload-2.1.2/plupload.full.min.js"></script>
<script type="text/javascript" src="<?=STATICURL;?>js/latest.js"></script>
<script type="text/javascript" src="<?=STATICURL;?>js/ad-upload.js"></script>
<script>
 $(".del_pic").live("click",function(){
            $(this).parent().html("");
        });
    $(document).ready(function() {
        $("#editAd").click(function(){
            var cover = $(".uploadpic").attr("img-original");
            var redirecturl = $("input[name='redirecturl']").val();
            var id = $("#idpalce").val();
            if(cover == "" || cover == undefined){
                layer.msg("背景图片不能为空");return false;   
            }
            $.post("<?=BASEURL?>luckydog/ad/editAd", {"redirecturl":redirecturl,"cover":cover,"id":id,type:1}, function(res) {
                if (res) {
                    window.parent.location.reload();
                }else{
                    layer.msg("失败");
                }
            });
        });
    });
</script>


